#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include"Vector.h"
using namespace std;

void test1()
{
	Vector::vector<int> v1;
	Vector::vector<int> v2(1);
	Vector::vector<int> v3(4, 2);
	Vector::vector<int> v4(v3);
	v1 = v3;
	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();

	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	v1.insert(v1.begin(), 100);
	v1.insert(v1.begin(), 200);
	v1.insert(v1.end(), 1000);
	v1.insert(v1.end(), 2000);
	v1.insert(v1.end(), 3000);

	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	Vector::vector<int> v5(v1.begin(), v1.end());
	for (auto& k : v5)
	{
		cout << k << " ";
	}
	cout << endl;
}

void test2()
{
	Vector::vector<int> v2(1);
	Vector::vector<int> v3(4, 2);
	Vector::vector<int> v4(v3);

	for (auto& k : v3)
	{
		cout << k << " ";
	}
	cout << endl;


	for (auto& k : v4)
	{
		cout << k << " ";
	}
	cout << endl;

	v2.push_back(1);
	v2.push_back(2);
	v2.push_back(3);
	v2.push_back(4);
	v2.push_back(5);
	v2.push_back(6);

	for (auto& k : v2)
	{
		cout << k << " ";
	}
	cout << endl;

	v2.pop_back();
	v2.pop_back();
	v2.pop_back();
	v2.pop_back();
	for (auto& k : v2)
	{
		cout << k << " ";
	}
	cout << endl;
}

void test3()
{
	Vector::vector<int> v1;
	Vector::vector<int> v2(4, 2);
	v1 = v2;

	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	v1.erase(v1.begin() + 3);
	v1.erase(v1.begin(), v1.begin() + 1);

	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	v1.pop_back();
	v1.pop_back();
	/*v1.pop_back();
	v1.pop_back();*/

	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;

	v1.reserve(15);

	v1.resize(20,1);
	for (auto& k : v1)
	{
		cout << k << " ";
	}
	cout << endl;
}
void test4()
{
	Vector::vector<int> myvector;

	for (int i = 1; i <= 10; i++)
	{
		myvector.push_back(i);
	}

	myvector.erase(myvector.begin() + 5);
	myvector.erase(myvector.begin() + 7);

	myvector.erase(myvector.begin(), myvector.begin() + 3);

	for (size_t i = 0; i < myvector.size(); ++i)
	{
		cout << ' ' << myvector[i];
	}
	cout << endl;
}

void test5()
{
	Vector::vector<string> v;
	v.reserve(10);
	v.push_back("xxxx");
	v.push_back("xxxx");
	v.push_back("xxxx");
	v.push_back("xxxx");
	v.push_back("xxxx");
	v.push_back("xxxx");

	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	v.resize(8);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	v.resize(15, "yyyy");
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	v.resize(3);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test6()
{
	Vector::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);
	v.push_back(7);
	v.push_back(8);
	v.push_back(9);

	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;


	Vector::vector<string> vstr;
	vstr.push_back("1111");
	vstr.push_back("1111");
	vstr.push_back("1111");
	vstr.push_back("1111");
	vstr.push_back("1111");

	for (auto e : vstr)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test7()
{
	Vector::vector<string> v1(5, "1111");
	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

	Vector::vector<int> v2(5, 1);
	for (auto e : v2)
	{
		cout << e << " ";
	}
	cout << endl;
}

int main()
{
	//test1();
	//test2();
	//test3();
	//test4();
	//test5();
	//test6();
	test7();
	return 0;
}